﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace comm_num_tp1
{
    public class GpGGA : GpsSubCommon
    {
        /*$GPGGA,123519,4807.038,N,01131.324,E,1,08,0.9,545.4,M,46.9,M, , *42
         
        123519 = Acquisition du FIX à 12:35:19 UTC
        4807.038,N = Latitude 48 deg 07.038' N
        01131.324,E = Longitude 11 deg 31.324' E
        1 = Fix qualification : (0 = non valide, 1 = Fix GPS, 2 = Fix DGPS)
        08 = Nombre de satellites en pousuite.
        0.9 = DOP (Horizontal dilution of position) Dilution horizontale.
        545.4,M = Altitude, en Metres, au dessus du MSL (mean see level) niveau moyen
        des Océans.
        46.9,M = Correction de la hauteur de la géoïde en Metres par raport à l'ellipsoîde
        WGS84 (MSL).
        (Champ vide) = nombre de secondes écoulées depuis la dernière mise à jour
        DGPS.
        (Champ vide) = Identification de la station DGPS.
        *42 = Checksum
        Non représentés CR et LF.*/

        #region constructor
        public GpGGA(string Iden, string Time, string Lat, string Lon, string Fix, string SatQty, string Dop, string Altitude, string Msl, string TimeStamp, string DgpsStation, string chksum)
        {
            StreamIden = Iden;
            StreamFix = Fix;
            StreamSatQty = SatQty;
            StreamDop = Dop;
            StreamMsl = Msl;
            StreamAltitude = Altitude;
            StreamDgpsStation = DgpsStation;
            StreamTime = Time;
            StreamLon = Lon;
            StreamLat = Lat;
            StreamTimestamp = TimeStamp;
            StreamChecksum = chksum;
            IsGsvList = false;
        }
        #endregion

        #region accessors
        public string StreamAltitude { get; set; }
        public string StreamFix { get; set; }
        public string StreamSatQty { get; set; }
        public string StreamDop { get; set; }
        public string StreamMsl { get; set; }
        public string StreamDgpsStation { get; set; }
        public string StreamRawStream { get; set; }
        #endregion

        public override string ToString()
        {
            string retour = "";
            retour += StreamIden + "," + StreamTime + "," + StreamLat + "," + StreamLon + "," + StreamFix + "," + StreamSatQty + "," +
                StreamDop + "," + StreamAltitude + "," + StreamMsl + "," + StreamTimestamp + "," + StreamDgpsStation + ',' + StreamChecksum;
            return retour;
        }
    }
}
